package holiday_demo.swing_study;

import javax.swing.*;
import java.awt.*;

public class swing_demo02 extends JFrame {
    public swing_demo02(String title) throws HeadlessException {
        super(title);

        //内容面板
        Container container=getContentPane();
        container.setLayout(new FlowLayout());

        //在内容面板中添加控件
        container.add(new JButton("按钮1"));
        container.add(new JButton("按钮2"));
        container.add(new JLabel("标签1"));

        //设置窗口大小
        setSize(300,500);

        //设置窗口可见
        setVisible(true);
    }

    public static void main(String[] args) {
        new swing_demo02("我的GUI程序");
    }
}
